package com.li.springbootproject.spring.initstaticvariable;

import org.redisson.api.RedissonClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author LiDong
 * @version 1.0.0
 * @createTime 2021年11月20日 16:24:00
 */
@Component
public class InitStaticVariableTwo {

    private static final Logger logger = LoggerFactory.getLogger(InitStaticVariableTwo.class);

    private static RedissonClient redissonClientOne;

    @Autowired()
    public void setRedissonClient(RedissonClient redissonClient){
        redissonClientOne=redissonClient;
        logger.info("redisclinet注入完成！");
    }

    public static void setList(){
        redissonClientOne.getList("one").add("two");
    }

}
